using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using TMS.Domain.Entity;

namespace TMS.Infrastructrue.Persistence
{
    public class TMSDbContext : DbContext
    {
        public TMSDbContext(DbContextOptions options) : base(options)
        {

        }

        protected override void OnModelCreating(ModelBuilder builder)
        {
            // 应用当前Assembly中定义的所有的Configurations，就不需要一个一个去写了。
            builder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly());

            base.OnModelCreating(builder);
        }

        public DbSet<TMSExceptionLog> CMSExceptionLog => Set<TMSExceptionLog>();
        public DbSet<TMSAuditLog> CMSAuditLog => Set<TMSAuditLog>();
        public DbSet<TMSIdentityUser> CMSIdentityUser => Set<TMSIdentityUser>();
        public DbSet<StuUsers> StuUsers => Set<StuUsers>();
        public DbSet<TeaUsers> TeaUsers => Set<TeaUsers>();
        public DbSet<Students> students => Set<Students>();
        public DbSet<Teachers> teachers => Set<Teachers>();
        public DbSet<College> colleges => Set<College>();
        public DbSet<Major> majors => Set<Major>();
        public DbSet<Class> classes => Set<Class>();
        public DbSet<Course> courses => Set<Course>();
        public DbSet<Book> books => Set<Book>();
        public DbSet<Dormitory> dormitories => Set<Dormitory>();
        public DbSet<Mark> marks => Set<Mark>();
        public DbSet<Role> roles => Set<Role>();
        public DbSet<Avatar> avatars => Set<Avatar>();
        public DbSet<Apply> applies => Set<Apply>();
        public DbSet<MajorChangeSave> majorChangeSaves => Set<MajorChangeSave>();
        public DbSet<Term> terms => Set<Term>();
        public DbSet<Subject> subjects => Set<Subject>();
        public DbSet<ElectiveCourse> electiveCourses => Set<ElectiveCourse>();
        public DbSet<UniLogin> uniLogins => Set<UniLogin>();
        public DbSet<Satisfaction> satisfactions => Set<Satisfaction>();
        public DbSet<OutStanding> outStandings => Set<OutStanding>();
        public DbSet<ClassTeacher> classTeachers => Set<ClassTeacher>();
    }
}